package com.morningstar.qs.basic.db.bean;

import java.util.Date;

import org.apache.commons.beanutils.BeanUtils;

import com.morningstar.qs.basic.db.util.BeanBase;

public class UserMessageInfo extends BeanBase implements  java.io.Serializable{

	
	/**
	 * 
	 */
	private static final long serialVersionUID = -6908285029215156790L;
	
	private int messageId;
	private short messageType;
	private String senderAddress;
	private String receiverAddress;
	private String subject;
	private String content;
	private String attachment;
	private Date createTime;
	
	

	public int getMessageId() {
		return messageId;
	}

	public void setMessageId(int messageId) {
		this.messageId = messageId;
	}

	public short getMessageType() {
		return messageType;
	}

	public void setMessageType(short messageType) {
		this.messageType = messageType;
	}

	public String getSenderAddress() {
		return senderAddress;
	}

	public void setSenderAddress(String senderAddress) {
		this.senderAddress = senderAddress;
	}

	public String getReceiverAddress() {
		return receiverAddress;
	}

	public void setReceiverAddress(String receiverAddress) {
		this.receiverAddress = receiverAddress;
	}

	public String getSubject() {
		return subject;
	}

	public void setSubject(String subject) {
		this.subject = subject;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getAttachment() {
		return attachment;
	}

	public void setAttachment(String attachment) {
		this.attachment = attachment;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	
	public UserMessageInfo() {
	}

	
	public UserMessageInfo(int messageId, short messageType,
			String senderAddress, String receiverAddress, String subject,
			String content, String attachment, Date createTime) {
		super();
		this.messageId = messageId;
		this.messageType = messageType;
		this.senderAddress = senderAddress;
		this.receiverAddress = receiverAddress;
		this.subject = subject;
		this.content = content;
		this.attachment = attachment;
		this.createTime = createTime;
	}

	
	public UserMessageInfo toDto() {
		UserMessageInfo dto=null;
		
		try {
			dto=new UserMessageInfo();
			BeanUtils.copyProperties(dto, this);
		} catch (Exception e) {
			e.printStackTrace();
		} 
		return dto;
	}
	
}
